<html>
<head>
<link rel="stylesheet" href="style-index.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>sans titre 1</title>
</head>

<body>

	<div id="container">
	
		<div id="top">
		<?php include 'header.php'; ?>
		</div>
	
		<div id="leftnav">
			<?php include ("menu.php"); ?>
		</div>
 
		<div id="content">



<?php //ARTICLES LES PLUS VUE
include 'include/Data.php';
$req = mysql_query('SELECT NumArticle,Titre,NbVue FROM article ORDER BY NbVue DESC');
$ligne = mysql_fetch_assoc($req);
$i = 1;
echo '<center>';
echo '<TABLE BORDER="1" id="table">';
echo '<CAPTION>Liste des articles les plus visités :</CAPTION>';
echo '<TR><TH>Article</TH><TH>Afficher</TH></TR>';
while (($ligne) && ($i <= 5))
{
echo '<TR><TD><a href="article.php?NumArticle='.$ligne['NumArticle'].'" class"type2">'.$ligne['Titre'].'</a></TD><TD><b>'.$ligne['NbVue'].'fois</b></TD></TR>';
$ligne = mysql_fetch_assoc($req);
$i++;
}
echo '</TABLE>';
echo '</center>';
mysql_close($connexion);
?>


<?php //ARTICLES LES PLUS RECENTS
include 'include/Data.php';
$req2 = mysql_query('SELECT NumArticle,Titre,DateArticle FROM article ORDER BY DateArticle DESC');
$ligne2 = mysql_fetch_assoc($req2);
$i2 = 1;
echo '<br>';
echo '<center>';
echo '<TABLE BORDER="1">';
echo '<CAPTION>Liste des dernier articles :</CAPTION>';
echo '<TR><TH>Article</TH><TH>Date du: </TH></TR>';
while (($ligne2) && ($i2 <= 5))
{
echo '<TR><TD><a href="article.php?NumArticle='.$ligne2['NumArticle'].'" class"type2">'.$ligne2['Titre'].'</a></TD><TD><b>'.$ligne2['DateArticle'].'</b></TD></TR>';
$ligne2 = mysql_fetch_assoc($req2);
$i2++;
}
echo '</TABLE>';
echo '</center>';
mysql_close($connexion);
?>


<?php //ARTICLES LES PLUS COMMENTE
include 'include/Data.php';
$req3 = mysql_query('SELECT article.NumArticle, Titre, COUNT(commentaire.NumArticle) as nb FROM article,commentaire WHERE article.NumArticle = commentaire.NumArticle GROUP BY TITRE ORDER BY nb DESC');
$ligne3 = mysql_fetch_assoc($req3);
$i3 = 1;
echo '<br>';
echo '<center>';
echo '<TABLE BORDER="1">';
echo '<CAPTION>Liste des articles les plus commentés :</CAPTION>';
echo '<TR><TH>Article</TH><TH>Commenté</TH></TR>';
while (($ligne3) && ($i3 <= 5))
{
echo '<TR><TD><a href="article.php?NumArticle='.$ligne3['NumArticle'].'">'.$ligne3['Titre'].'</a></TD><TD><b>'.$ligne3['nb'].'fois</b></TD></TR>';
$ligne3 = mysql_fetch_assoc($req3);
$i3++;
}
echo '</TABLE>';
echo '</center>';
mysql_close($connexion);
?>

		</div>
 
		<div id="footer">
		<?php include 'footer.php'; ?>
		</div>
		
	</div>
</body>
</html>
